package vip.yuange.gsyzm.utils;

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class FileUtils {
	
	public static byte[] getFileByteArray(String filePath) throws IOException {  
	    try (InputStream is = new FileInputStream(filePath);  
	         ByteArrayOutputStream baos = new ByteArrayOutputStream()) {  
	        byte[] buffer = new byte[1024];  
	        int bytesRead;  
	        while ((bytesRead = is.read(buffer)) != -1) {  
	            baos.write(buffer, 0, bytesRead);  
	        }  
	        return baos.toByteArray();  
	    }
	}

}
